import React,{Component} from 'react'
import {View,Text,TextInput,TouchableOpacity} from 'react-native'

export default class Home2 extends Component{
    constructor(props){
        super(props);
        this.input='dd';
    }

    _goback=()=>{
     

        this.props.navigation.state.params.pro(this.input);

        this.props.navigation.goBack();
    }

    inpu=(test)=>{
        console.log('123'+test);
        this.input=test;
    }

    render(){
        return(
            <View style={{flex:1,alignItems:'center'}}>
            <TextInput style={{height:40,marginTop:100}} placeholder='输入内容' onChangeText={this.inpu}/>
            <Text style={{marginTop:40}}>{this.props.navigation.state.params.id}</Text>
            <TouchableOpacity style={{marginTop:50}} onPress={this._goback}>
            <Text>返回</Text>
            </TouchableOpacity>
            </View>
        )
    }

}